package ssw.gui.japplet;

import javax.swing.JApplet;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class SswJApplet extends JApplet implements HasContentPane {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2771098035596439937L;
	
	private final AppCore app = new AppCore(this);
	
	@Override
	public void init() {
		try {
			SwingUtilities.invokeAndWait(new Runnable() {
				@Override
				public void run() {
					initComponents();
				}
			});
		} catch (final Exception e) {
			e.printStackTrace();
		}
	}

	private void initComponents() {
		app.initComponent();
	}
	
	@Override
	public void switchMainPanel(JPanel panel) {
		getContentPane().removeAll();
		getContentPane().add(panel);
	}
}
